home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / oop_tp55.zip / LIST3_2.PAS < prev    next >
Pascal/Delphi Source File  |  1990-03-08  |  1KB  |  63 lines

  1. program Listing 3_2;
  2.  
  3. uses Tags, Crt;
  4.  
  5. var
  6.    LT100,
  7.    FT100  : Analog;
  8.    PSL100 : LoSwitch;
  9.    PSH100 : HiSwitch;
  10.    EY100  : Pump;
  11.    time   : integer;
  12.  
  13. begin
  14.  
  15.      LT100.Init( 'LT100', 512, 50, 250 );
  16.      FT100.Init( 'FT100', 2048, 0, 10000 );
  17.      PSL100.Init( 'PSL100', 60, HtToPSI(LT100.GetValue) );
  18.      PSH100.Init( 'PSH100', 75, HtToPSI(LT100.GetValue) );
  19.      EY100.Init( 'EY100', off, 8000);
  20.      time := 0;
  21.  
  22.      repeat
  23.  
  24.      Inc( time );  { increment the time }
  25.      LT100.PutValue( LT100.GetValue - FlowToDeltaHt(FT100.GetValue) );
  26.  
  27.      PSL100.PutReading( HtToPSI(LT100.GetValue) );
  28.      PSH100.PutReading( HtToPSI(LT100.GetValue) );
  29.  
  30.      if Quiet.IsOff then
  31.         writeln( f, 'Level is ', LT100.GetValue:2:2, 
  32.                     ' ft at minute ', time );
  33.  
  34.      if PSL100.GetStatus = on then
  35.         EY100.PutStatus( ON );
  36.      if PSH100.GetStatus = on then
  37.         EY100.PutStatus( OFF );
  38.  
  39.      LT100.PutValue( LT100.GetValue + FlowToDeltaHt(EY100.Flow ));
  40.  
  41. { if the next line of code is not commented out, you'll see only
  42.   reports for even values of time; otherwise, reports for each
  43.   time value will be printed. }
  44.  
  45. {    if (time mod 2 = 0) then Quiet.On else Quiet.Off;     }
  46.  
  47.      until KeyPressed;
  48.      Quiet.On;
  49. end.
  50.  
  51. {Listing 3-2 }
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.